{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "bc15a9bc",
   "metadata": {},
   "source": [
    "#### flask框架"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "ec1f8c94",
   "metadata": {},
   "outputs": [],
   "source": [
    "from flask import Flask\n",
    "app=Flask(__name__)\n",
    "# 创建路由实例\n",
    "@app.route('/')\n",
    "def index():\n",
    "    return '<h> Hello World!</h>'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "8f6e1e7b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " * Serving Flask app '__main__'\n",
      " * Debug mode: off\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.\n",
      " * Running on all addresses (0.0.0.0)\n",
      " * Running on http://127.0.0.1:80\n",
      " * Running on http://192.168.0.196:80\n",
      "Press CTRL+C to quit\n",
      "127.0.0.1 - - [01/May/2025 10:24:51] \"GET / HTTP/1.1\" 200 -\n",
      "127.0.0.1 - - [01/May/2025 10:24:52] \"GET /favicon.ico HTTP/1.1\" 404 -\n"
     ]
    }
   ],
   "source": [
    "# 启动服务器\n",
    "if __name__=='__main__':\n",
    "    # app.run(debug=True)\n",
    "    app.run(host='0.0.0.0',port=80)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pytorch1",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.20"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
